package xuesheng

import (
	"fmt"
	"time"
)

func Login() (bool, time.Time, string, int) {
	fmt.Println("请输入用户名")
	var name string
	fmt.Scanln(&name)
	fmt.Println("请输入密码")
	var pswd string
	fmt.Scanln(&pswd)
	var age int
	fmt.Println("请输入您的年龄")
	fmt.Scanln(&age)
	if name == "jingxioabai" && pswd == "123456" {
		return true, time.Now(), name, age
	}

	return false, time.Now(), "", 0
}

var moneyPacket float32

func Chongzhi(moneyKind string, edu float32) bool {
	switch moneyKind {
	case "mop":
		moneyPacket = moneyPacket + edu*1.14
	case "rmb":
		moneyPacket = moneyPacket + edu
	case "krw":
		moneyPacket = moneyPacket + edu*189.17
	case "chf":
		moneyPacket = moneyPacket + edu*0.12
	default:
		fmt.Println("我们只接受欧元，人民币，瑞士法郎和韩元充值")
		return false
	}
	fmt.Println("充值完成，现在的额度是：", moneyPacket)
	return true
}
func Goumai() {
	fmt.Println("请选择需要购买给产品，1，10抽小卡，2.全套专辑，3.迷你专辑， 4.圣诞特辑，5.主题杂志")
	if moneyPacket <= 0 {
		fmt.Println("余额不足,请先充值")
		return
	}
	var caidan int
	fmt.Scanln(&caidan)
	switch caidan {
	case 1:
		if moneyPacket < 100 {
			fmt.Println("余额不足，无法购买迷你专辑")
			return
		}
		moneyPacket = moneyPacket - 100
	case 2:
		if moneyPacket < 370 {
			fmt.Println("余额不足，无法购买全套专辑")
			return
		}
		moneyPacket = moneyPacket - 370
	case 3:
		if moneyPacket < 120 {
			fmt.Println("余额不足，无法购买10抽小卡")
			return
		}
		moneyPacket = moneyPacket - 120

	}

	fmt.Println("购买完成，现在余额还剩:", moneyPacket)

}

func BMI() {

}
